package com.ardo.controller;

import com.ardo.service.ProductService;
import com.ardo.utils.AppUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * 商品
 * F***
 */
@RestController
@RequestMapping("/product")
public class ProductController {

    @Autowired
    private ProductService productService;

    @RequestMapping("/detail")
    public String detail(HttpServletRequest request) {
        AppUtils.printTitle("F002 - 商品详情");
        String id  = request.getParameter("id");
        String result = productService.queryProductDetail(Integer.parseInt(id));
        System.out.println("商品详情结果: " + result);
        return result;
    }
}
